package com.slz3.business.module.messageManagement.mesActivity.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.messageManagement.mesActivity.domain.MesActivity;
import com.slz3.business.module.messageManagement.mesActivity.domain.MesActivityCondition;
import org.springframework.stereotype.Component;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

@Component
public class MesActivityResAtomic {

    public Mono<ServerResponse> add_$MesActivityUpdateLock(ServerRequest req, MesActivity mesActivity) {
        return MesActivityResSafeValid.add(req, mesActivity) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MesActivityResExecutor.add(req, mesActivity);
    }

    public Mono<ServerResponse> delete_$MesActivityUpdateLock(ServerRequest req, MesActivityCondition mesActivityCondition) {
        return MesActivityResSafeValid.delete(req, mesActivityCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MesActivityResExecutor.delete(req);
    }

    public Mono<ServerResponse> modify_$MesActivityUpdateLock(ServerRequest req, MesActivity mesActivity) {
        return MesActivityResSafeValid.modify(req, mesActivity) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MesActivityResExecutor.modify(req, mesActivity);
    }

    public Mono<ServerResponse> info_$MesActivityUpdateLock(ServerRequest req) {
        return MesActivityResSafeValid.info(req) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MesActivityResExecutor.info(req);
    }

    public Mono<ServerResponse> auditSubmit_$MesActivityUpdateLock(ServerRequest req, MesActivityCondition mesActivityCondition) {
        return MesActivityResSafeValid.auditSubmit(req, mesActivityCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MesActivityResExecutor.auditSubmit(req);
    }

    public Mono<ServerResponse> audit_$MesActivityUpdateLock(ServerRequest req, MesActivityCondition mesActivityCondition) {
        return MesActivityResSafeValid.audit(req, mesActivityCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MesActivityResExecutor.audit(req);
    }

    public Mono<ServerResponse> auditReject_$MesActivityUpdateLock(ServerRequest req, MesActivityCondition mesActivityCondition) {
        return MesActivityResSafeValid.auditReject(req, mesActivityCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MesActivityResExecutor.auditReject(req);
    }


    public Mono<ServerResponse> usingEnable_$MesActivityUpdateLock(ServerRequest req, MesActivityCondition mesActivityCondition) {
        return MesActivityResSafeValid.usingEnable(req, mesActivityCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MesActivityResExecutor.usingEnable(req);
    }

    public Mono<ServerResponse> usingDisable_$MesActivityUpdateLock(ServerRequest req, MesActivityCondition mesActivityCondition) {
        return MesActivityResSafeValid.usingDisable(req, mesActivityCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MesActivityResExecutor.usingDisable(req);
    }
}
